var AnimateCSS = Class.create({
    initialize: function(o){
        // o --> {name}
        var supportedType = "flash bounce shake tada swing wobble wiggle pulse"
                            + " flip flipInX flipOutX flipInY flipOutY"
                            + " fadeIn fadeInUp fadeInDown fadeInLeft fadeInRight fadeInUpBig fadeInDownBig fadeInLeftBig fadeInRightBig"
                            + " fadeOut fadeOutUp fadeOutDown fadeOutLeft fadeOutRight fadeOutUpBig fadeOutDownBig fadeOutLeftBig fadeOutRightBig"
                            + " bounceIn bounceInDown bounceInUp bounceInLeft bounceInRight"
                            + " bounceOut bounceOutDown bounceOutUp bounceOutLeft bounceOutRight"
                            + " rotateIn rotateInDownLeft rotateInDownRight rotateInUpLeft rotateInUpRight"
                            + " rotateOut rotateOutDownLeft rotateOutDownRight rotateOutUpLeft rotateOutUpRight"
                            + " lightSpeedIn lightSpeedOut"
                            + " hinge rollIn rollOut";
        var _o = o || {};
        if(supportedType.include(_o.name)){
            this.name = _o.name;
        }
        else{
            return null;
        }
    },
    execute: function(caller, target, args){
        var _this = this;
//        $j("#" + caller.id).bind('webkitAnimationEnd', function(event){
//            $j("#" + caller.id).removeClass("animated repeat "+ _this.name);
//        });
        $j("#" + caller.id).removeClass("animated repeat " + _this.name).addClass("animated repeat " + _this.name);

    }
});